import Command from "./command"
import transitionType from "../enum/transitionType.enum"
export class EnablePinEditingCommand extends Command {
  constructor(enabled: any) {
    super()
    this.payload = { enabled }
  }
}
export class PreviewPinCommand extends Command {
  constructor(pin: any, pinType: any) {
    super()
    this.payload = { pin, pinType }
  }
}
export class SelectPinCommand extends Command {
  constructor(id: any, pinType: any, transition = transitionType.Instant) {
    super()
    this.payload = { id, pinType, transition }
  }
}
export class OpenPinCommand extends Command {
  constructor(id: any, pinType: any, transition: any, attachmentId: any, listIndex = -1) {
    super()
    this.payload = {
      id,
      pinType,
      transition,
      attachmentId,
      listIndex
    }
  }
}
export class AdjustPinStemLengthCommand extends Command {
  constructor(id: any, pinType: any, stemLength: any) {
    super()
    this.payload = { id, pinType, stemLength }
  }
}
export class ClickAwayFromPinCommand extends Command {
  constructor() {
    super()
  }
}
export class PlacePinCommand extends Command {
  constructor() {
    super()
  }
}
export class MovePinCommand extends Command {
  constructor(id: any, pos: any) {
    super()
    this.payload = { id, pos }
  }
}
export class CancelNewPinCommand extends Command {
  constructor() {
    super()
  }
}
export class PinUnselectCommand extends Command {
  constructor(id: any) {
    super()
    this.id = "PIN_UNSELECT"
    this.payload = { id }
  }
}
